#define _CRT_SECURE_NO_WARNINGS 2

#include<list>
#include<vector>
#include<stack>
#include<deque>
#include<iostream>
#include<algorithm>
using namespace std;
#include"Queue.h"
#include"Stack.h"

void test1() {
	stack<int> st;
	st.push(1);
	++st.top();
	cout << st.top() << endl;
}

void test2() {
	A::queue<int, list<int>> qu;
	qu.push(1);
	qu.push(2);
	qu.push(3);
	cout << "size  " << qu.size() << endl;
	qu.pop();
	while (!qu.empty()) {
		cout << qu.front() << " ";
		qu.pop();
	}
}

void test3() {
	A::stack<int, vector<int> > st;
	st.push(1);
	st.push(2);
	st.push(3);
	st.pop();
	while (!st.empty()) {
		cout << st.top() << " ";
		st.pop();
	}
}

void test4() {
	srand((unsigned)time(0));
	deque<int> d;
	vector<int> v;
	const int sz = 10000000;
	for (int i = 0; i < sz; ++i) {
		int e = rand();
		d.push_back(e);
		v.push_back(e);
	}

	int start1 = clock();
	sort(d.begin(), d.end());
	int end1 = clock();

	int start2 = clock();
	sort(v.begin(), v.end());
	int end2 = clock();

	cout << "deque waste time  " << end1 - start1 << endl;
	cout << "vector waste time  " << end2 - start2 << endl;
}

int main() {
	test4();
	return 0;
}